package com.jason.java.singleton;

/**
 * @Author: Jason
 * @Date: 2017/7/23
 * @Time: 20:32
 */
public class LazyThreadSafeSynchronized {

    private static  LazyThreadSafeSynchronized INSTANCE;

    private LazyThreadSafeSynchronized(){}

    // 因为每次在调用getInstance方法的时候都会加锁 比较消耗资源
    public static synchronized LazyThreadSafeSynchronized getInstance() {
        if (INSTANCE == null) {
            INSTANCE = new LazyThreadSafeSynchronized();
        }

        return INSTANCE;
    }


}
